package com.ruoyi.erp.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.erp.mapper.SettleReceivableMapper;
import com.ruoyi.erp.domain.SettleReceivable;
import com.ruoyi.erp.service.ISettleReceivableService;
import com.ruoyi.common.core.text.Convert;

/**
 * 外派收款明细Service业务层处理
 * 
 * @author sauger
 * @date 2022-03-30
 */
@Service
public class SettleReceivableServiceImpl implements ISettleReceivableService 
{
    @Autowired
    private SettleReceivableMapper settleReceivableMapper;

    /**
     * 查询外派收款明细
     * 
     * @param id 外派收款明细主键
     * @return 外派收款明细
     */
    @Override
    public SettleReceivable selectSettleReceivableById(Integer id)
    {
        return settleReceivableMapper.selectSettleReceivableById(id);
    }

    /**
     * 查询外派收款明细列表
     * 
     * @param settleReceivable 外派收款明细
     * @return 外派收款明细
     */
    @Override
    public List<SettleReceivable> selectSettleReceivableList(SettleReceivable settleReceivable)
    {
        return settleReceivableMapper.selectSettleReceivableList(settleReceivable);
    }

    /**
     * 新增外派收款明细
     * 
     * @param settleReceivable 外派收款明细
     * @return 结果
     */
    @Override
    public int insertSettleReceivable(SettleReceivable settleReceivable)
    {
        settleReceivable.setCreateTime(DateUtils.getNowDate());
        return settleReceivableMapper.insertSettleReceivable(settleReceivable);
    }

    /**
     * 修改外派收款明细
     * 
     * @param settleReceivable 外派收款明细
     * @return 结果
     */
    @Override
    public int updateSettleReceivable(SettleReceivable settleReceivable)
    {
        return settleReceivableMapper.updateSettleReceivable(settleReceivable);
    }

    /**
     * 批量删除外派收款明细
     * 
     * @param ids 需要删除的外派收款明细主键
     * @return 结果
     */
    @Override
    public int deleteSettleReceivableByIds(String ids)
    {
        return settleReceivableMapper.deleteSettleReceivableByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除外派收款明细信息
     * 
     * @param id 外派收款明细主键
     * @return 结果
     */
    @Override
    public int deleteSettleReceivableById(Integer id)
    {
        return settleReceivableMapper.deleteSettleReceivableById(id);
    }

    @Override
    public List<SettleReceivable> selectSettleReceivableByPlanId(Integer planId) {
        return settleReceivableMapper.selectSettleReceivableByPlanId(planId);
    }
}
